<?php
class AppController extends Controller {
	var $components = array('MgMenu','Auth','Acl','Session');
	var $helpers = array('Ajax','Javascript','Session', 'Html', 'Form');
	function beforeFilter() {
		$this->Auth->userModel = 'MgUsuario';
		//$this->Auth->authorize = 'actions';					
		$this->Auth->fields = array('username' => 'usuario', 'password' => 'clave');
		$this->Auth->userScope = array('MgUsuario.mg_estado_usuario_id' => '1');
		$this->Auth->actionPath = 'controllers/';
		$this->Auth->loginError = "Clave o Usuario Incorrecto";
		$this->Auth->authError = "No Tiene Acceso a Esta Funcion ";
		$this->Auth->logoutRedirect = '../../../../../../../../';	
	}

	
	function beforeRender(){		
		$this->data = am($this->data, array('MgMenu'=>$this->MgMenu->fetchData(&$this)));
	}
	 
}
?>